// CameraDelete.cpp : implementation file
//

#include "stdafx.h"
#include "Measure.h"
#include "CameraDelete.h"
#include "afxdialogex.h"


// CCameraDelete dialog

IMPLEMENT_DYNAMIC(CCameraDelete, CDialogEx)

CCameraDelete::CCameraDelete(CWnd* pParent, const CCameraList& cameras)
	: CDialogEx(CCameraDelete::IDD, pParent)
  , index_of_camera_to_delete_(0)
  , cameras_(cameras)
{

}

CCameraDelete::~CCameraDelete()
{
}

void CCameraDelete::DoDataExchange(CDataExchange* pDX)
{
  CDialogEx::DoDataExchange(pDX);
  DDX_LBIndex(pDX, IDC_CAMERA_LIST, index_of_camera_to_delete_);
  DDX_Control(pDX, IDC_CAMERA_LIST, wnd_camera_list_);
}


BEGIN_MESSAGE_MAP(CCameraDelete, CDialogEx)
END_MESSAGE_MAP()


// CCameraDelete message handlers


BOOL CCameraDelete::OnInitDialog()
{
  CDialogEx::OnInitDialog();

  for (int n=0; n<cameras_.num_cameras(); ++n) {
    wnd_camera_list_.AddString(cameras_.camera(n)->Name().c_str());
  }

  return TRUE;
}
